<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        //==========
        // let a = 1
        // function b(a) {
        //     a = 2
        //     console.log(a) //2
        // }
        // b(a)
        // console.log(a) //1 


        //==========
        // let b = c;
        // let c = 1;
        // function a(b = c, c = 1) {
        //     console.log(b, c)//报错
        // }
        // a()
        function a(c = 1, b = c) {
            console.log(b, c)//1 1
        }
        a()





        //=========
        // let a = b = 10;
        // // let a = 10;
        // // var b = 10;
        // (function () {
        //     let a = b = 20
        //     // let a = 20;
        //     // b = 20;
        // })()
        // console.log(a)//10
        // console.log(b)//20




        //========
        // var arr = [0, 1, 2]
        // arr[10] = 10
        // console.log(arr);//[0, 1, 2, empty × 7, 10]
        // console.log(arr[3]);//undefined
        // console.log(arr.filter(function (x) {
        //     return x === undefined
        // }))







        //========
        var name = 'World';
        (function () {
            
            if (typeof name === 'undefined') {
                var name = "Jack"
                console.log('Goodbye ' + name)
            } else {
                console.log('Hello ' + name)
            }
        })()





        //=========
        let { a, b, c } = { c: 3, b: 2, a: 1 }
        console.log(a, b, c)





    </script>
</body>

</html>